
// C++ STL
#include <string>
#include <sstream>
// owner
#include "LogCommon.hpp"

#ifndef LOG_MESSAGE_HPP
#define LOG_MESSAGE_HPP

namespace tulun
{
    class LogMessage
    {
    private:
        std::string header_;
        std::string text_;
        tulun::LOG_LEVEL level_;

    public:
        LogMessage(const tulun::LOG_LEVEL &level,
                   const std::string &filename,
                   const std::string &funcname,
                   const int line);
        ~LogMessage();
        template <class _Ty>
        LogMessage &operator<<(const _Ty &text)
        {
            std::stringstream ss;
            ss << text;
            text_ += ss.str();
            return *this;
        }
        const tulun::LOG_LEVEL &getLogLevel() const;
        const std::string toString() const;
    };
} // namespace tulun

#endif